import java.sql.Array;
import java.sql.Struct;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner s=new Scanner(System.in);

        int n=s.nextInt();
        int index=s.nextInt();
        Student[] students=new Student[n];
        for (int i = 0; i < n; i++) {
            int id=s.nextInt();
            double score=s.nextDouble();
            students[i]=new Student(id,score);

        }

//        Arrays.sort(students);

        for (int i = 0; i < n-1; i++) {
            for (int j = 0; j < n - 1-i; j++) {
                Student tmp=new Student();
                if(students[j].score<students[j+1].score){
                    tmp=students[j];
                    students[j]=students[j+1];
                    students[j+1]=tmp;
                }
            }
        }
        System.out.printf("%d %.1f",students[index-1].id,students[index-1].score);


    }
}
class Student implements Comparable<Student> {
    int id;
    double score;

    public Student() {
    }

    public Student(int id, double score) {
        this.id = id;
        this.score = score;
    }

    @Override
    public int compareTo(Student o) {
        if(o.score==this.score){
            return 0;
        }
        return o.score>this.score?1:-1;
    }
}